/**
 * FileSizeComparator.java
 * @author: liuex
 * 2007-12-24 ����10:17:46
 *
 * note: 
 */
package lex.explorer.file;

import org.lex.explorer.FileInfo;
import org.lex.utils.CategoryComparator;

public class FileSizeComparator implements CategoryComparator<FileInfo>
{
	@Override
	public int compare( FileInfo e1, FileInfo e2 )
	{
		return (int) (e1.getSize() - e2.getSize());
	}

	@Override
	public int getCategory( FileInfo file )
	{
		if( file.isDirectory() )
			return 0;
		return 1;
	}
}
